package com.centerm.bluetooth.ibridge.listener;

import com.centerm.bluetooth.ibridge.BluetoothIBridgeDevice;

/**
 * Interface definition for callbacks to be invoked when a Bluetooth event
 * occurs.These events include:<br>
 * &nbsp&nbsp&nbsp&nbsp<b>a,</b> {@link #onDiscoveryFinished()}<br>
 * &nbsp&nbsp&nbsp&nbsp<b>b,</b>
 * {@link #onDeviceFound(BluetoothIBridgeDevice)}<br>
 * &nbsp&nbsp&nbsp&nbsp<b>c,</b>
 * {@link #onDeviceBonded(BluetoothIBridgeDevice)}<br>
 * &nbsp&nbsp&nbsp&nbsp<b>d,</b>
 * {@link #onDeviceConnected(BluetoothIBridgeDevice)}<br>
 * &nbsp&nbsp&nbsp&nbsp<b>e,</b>
 * {@link #onDeviceDisconnected(BluetoothIBridgeDevice, String)}<br>
 * &nbsp&nbsp&nbsp&nbsp<b>f,</b>
 * {@link #onDeviceConnectFailed(BluetoothIBridgeDevice, String)}<br>
 * &nbsp&nbsp&nbsp&nbsp<b>g,</b>
 * {@link #onWriteFailed(BluetoothIBridgeDevice, String)}<br>
 */
public interface EventReceiver {
    /**
     * This method is called when discover procedure ends.
     */
    void onDiscoveryFinished();

    /**
     * This method is called when device is found in discovery procedure.
     *
     * @param device the device discovered.
     */
    void onDeviceFound(BluetoothIBridgeDevice device);

    /**
     * This method is called when device has been bonded successfully.
     *
     * @param device the device which has been bonded.
     */
    void onDeviceBonded(BluetoothIBridgeDevice device);

    /**
     * This method is called when device has been connected successfully.
     *
     * @param device the device which has been connected.
     */
    void onDeviceConnected(BluetoothIBridgeDevice device);

    /**
     * This method is called when device has been disconnected successfully.
     *
     * @param device       the device which has been disconnected.
     * @param exceptionMsg the exception message for disconnect reason.
     */
    void onDeviceDisconnected(BluetoothIBridgeDevice device, String exceptionMsg);

    /**
     * This method is called when device has failed to connect.
     *
     * @param device       the device which failed to connect.
     * @param exceptionMsg the exception message for connect failure.
     */
    void onDeviceConnectFailed(BluetoothIBridgeDevice device, String exceptionMsg);

    /**
     * This method is called when write data failed.
     *
     * @param device       the device which has connected.
     * @param exceptionMsg the exception message for write failure.
     */
    void onWriteFailed(BluetoothIBridgeDevice device, String exceptionMsg);
}
